import React from 'react'
import store from '../../store/store'
import { getMovieAction } from '../../store/actions/movieAction'
export default function Movie() {
    const { count } = store.getState().count
    const { movieList } = store.getState().movie
    const getMovieList = () => {
        store.dispatch(getMovieAction())
    }
    return (
        <div>
            <p>我要拿到Count的值{count}</p>
            <h3>有{movieList.length}个电影</h3>
            <button onClick={getMovieList}>获取电影数据</button>
            <ul>
                {
                    movieList.map(item => {
                        return <li key={item.tvId}>{item.albumName}</li>
                    })
                }
            </ul>
        </div>
    )
}
